import { BadRequestException, PipeTransform } from "@nestjs/common";
export class ParseIntPipe implements PipeTransform<string> {
  transform(value: string) {
    const val = parseInt(value, 10);
    if (isNaN(val)) {
      throw new BadRequestException("Validation failed");
    }
    return val;
  }
}
